<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
        1.class 可以定义一个类
        2.constructor 构造函数，new关键字实例化一个对象时调用
        3.super 指父类
        */
        class Person{
            constructor(name,age){
                console.log("p")
                this.name=name;
                this.age=age;
            }
            sayName(){
                console.log(this.name)
            }
        }
        class Student extends Person{
            constructor(name,age,skill){
                // console.log("s")
                super(name,age);
                this.skill=skill;
                // super.sayName();
            }
        }
        var s =new Student("lisi",19,"wechat");
        s.sayName();
    </script>
</body>
</html>